home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_chapeldoor.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  134 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_ChapelDoor.cog
  4. #
  5. # This is the generic door with a camera attached
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     activate
  16.     message     entered
  17.     
  18.     thing       wheelfloordoor     
  19.     thing       elevplat     
  20.     thing       elevplatbutn     
  21.     
  22.     thing       camera0
  23.     thing       camera0_tgt0
  24.            
  25.     thing       player                      local
  26.     
  27.     int         flag=0                      local
  28.     int         actcheck=0                  local
  29.     int         startchan                   local
  30.     int         movechan                    local
  31.     int         wepnum=1                    local
  32.     int         lastrand=-1                 local
  33.     int         currand=0                   local
  34.  
  35.     
  36.     sound       indylineb0=inxj058.wav      local
  37.     sound       indylineb1=inxj059.wav      local
  38.     sound       indylineb2=inxj060.wav      local
  39.     sound       indylineb3=inxj061.wav      local
  40.     sound       indylineb4=inxj090.wav      local
  41.     sound       indylineb5=inxj095.wav      local
  42.       
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. #........................................................................................
  50. startup:
  51.  
  52.     player = GetLocalPlayerThing();
  53.     //SetCollideType(elevplatbutn, 0);
  54.     
  55.     return;
  56.  
  57. #........................................................................................
  58. entered:
  59.  
  60.     if ((GetSenderRef() == elevplat) && (GetSourceRef() == player) && (GetCurFrame(elevplat) == 0) && (flag == 0))
  61.     {
  62.         flag = 1;
  63.         sleep(1);
  64.         MoveToFrame(elevplat, 1, 1);
  65.     }
  66.     
  67.     return;   
  68.     
  69. #........................................................................................
  70. activate:
  71.  
  72.     if ((GetSenderRef() == elevplatbutn) && (actcheck == 0) && (GetCurItem(player) == 0))
  73.     {
  74.         actcheck=1;
  75.         SetActorFlags(player, 0x200000);
  76.         StopThing(player);
  77.         StartCutscene(1);
  78.         While(wepnum !=0)
  79.         {
  80.             wepnum = GetCurWeapon(player);
  81.             DeselectWeaponWait(player);
  82.             DeselectWeapon(player);
  83.             //printint(wepnum);
  84.         }
  85.         PlayMode(player, 60, 0);
  86.         //print("activating button");
  87.         MoveToFrame(elevplatbutn, 1, 1);
  88.         WaitForStop(elevplatbutn);
  89.         Sleep(1);
  90.         
  91.         SetCameraFocus(2, camera0);
  92.         SetCameraSecondaryFocus(2, camera0_tgt0);
  93.         SetCurrentCamera(2);
  94.         
  95.         Rotate(wheelfloordoor, 29.0, 0, 3);
  96.         SetCameraFOV(110, 1, 2);
  97.         WaitForStop(wheelfloordoor);
  98.         Sleep(1);
  99.         
  100.         SetCameraLookInterp(2, 0);
  101.         SetCameraPosInterp(2, 0);
  102.         SetCameraInterpSpeed(2, 0);
  103.         SetCurrentCamera(1);
  104.         SetCameraFOV(90, 0, 0);
  105.         EndCutscene();
  106.         ClearActorFlags(player, 0x200000);
  107.         wepnum = 1;
  108.  
  109.     }
  110.     
  111.     if ((GetCurItem(player) != 0) && (GetSenderRef() == elevplatbutn))
  112.     {
  113.         StopThing(player);
  114.         StartCutscene(0);
  115.         SetActorFlags(player, 0x200000);
  116.         currand = RandBetween(0, 5);
  117.         While (lastrand == currand)
  118.         {
  119.             currand = RandBetween(0, 5);
  120.         }
  121.         PlayVoice(player, indylineb0[currand], 1, 1);
  122.         lastrand = currand;
  123.         EndCutscene();
  124.         ClearActorFlags(player, 0x200000);
  125.     }
  126.     
  127.     return;
  128.     
  129. #........................................................................................                    
  130.  
  131. end
  132.  
  133.  
  134.